﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Miner.UI.Controls.Interfaces;
using Miner.UI.Forms.Interfaces;

namespace Miner.UI.Forms
{
    public partial class MainForm : Form, IGameForm
    {
        public MainForm()
        {
            InitializeComponent();
        }

        public void Freeze()
        {
            this.SuspendLayout();
        }

        public void UnFreeze()
        {
            this.ResumeLayout();
        }


        public void HideFromUser()
        {
            this.Hide();
        }

        public void UnHideFromUser()
        {
            this.Show();
        }


        public IDrawAreaCtrl DrawAreaCtrl
        {
            get { return drawArea; }
        }

        private void drawArea_MouseUp(object sender, MouseEventArgs e)
        {
            if(BlockClicked!=null)
            {
                BlockClicked(this, e);
            }
        }


        public event MouseEventHandler BlockClicked;

        private void MainForm_KeyUp(object sender, KeyEventArgs e)
        {
            if(this.KeyUpOnForm!=null)
            {
                this.KeyUpOnForm(sender,e);
            }
        }


        public event KeyEventHandler KeyUpOnForm;


        public void Display()
        {
            this.ShowDialog();
        }


        public IGameInfoCtrl GameInfoCtrl
        {
            get { return gameInfoCtrl; }
        }
    }
}
